package springProvider.service;


import org.springframework.context.annotation.Bean;

import hardy.grpc.common.lib.json.MethodRequest;
import hardy.grpc.common.lib.json.MethodResponse;
import hardy.grpc.helper.server.target.spring.RpcProviderTargetBean;
import hardy.grpc.server.CallMethodServer;
import io.grpc.stub.StreamObserver;
import net.devh.boot.grpc.server.service.GrpcService;

@GrpcService
public class GrpcServer extends CallMethodServer{
	 
	{
		super.setTargetBean(rpcProviderTargetBean());
	}
	@Override
	public void call(MethodRequest request, StreamObserver<MethodResponse> responseObserver) {
		super.call(request, responseObserver);
	}
	
	@Bean
    public RpcProviderTargetBean rpcProviderTargetBean() {
     return RpcProviderTargetBean.getInstance();
    } 
}
